package com.cailu.rabmq.sender.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.cailu.rabmq.sender.sender.SenderConfTopicTemplate;
import com.cailu.rabmq.sender.version.ApiVersionConstant;
import com.cailu.rabmq.sender.version.ApiVersions;

/**
 * @author cailu
 * @filename SenderConfTopicController
 * @description Topic转发模式
 * @date 2020/3/31 15:43
 */
@Api(value = "10002-Topic 转发模式", tags = {"10002-Topic 转发模式"})
@RestController
public class SenderConfTopicController {

	@Autowired
	private SenderConfTopicTemplate senderConfTopicTemplate;

	/**
	 * 功能描述  指定转发的路由
	 * @param str WATCHER_ALARMS
	 * @return java.lang.String
	 * @author cailu
	 * @date 2020/4/1 14:18
	 */
	@GetMapping("sendTopictemplate")
	@ApiOperation(value = "20001-创建 Topic转发模式 发布者", notes = "创建 Topic转发模式 发布者")
	@ApiVersions(group = ApiVersionConstant.FAP_APP100)
	public String sendTopictemplate(@ApiParam(value = "自定义发送能容") @RequestParam(value = "str") String str) {
		senderConfTopicTemplate.sendTopictemplate(str);
		return "Topic转发模式 创建成功！";
	}

	/**
	 * 功能描述 指定到转发的路由
	 * @param str
	 * @return java.lang.String
	 * @author cailu
	 * @date 2020/4/1 14:15
	 */
	@GetMapping("sendTopicToMestemplate")
	@ApiOperation(value = "20002-创建指定到转发的路由", notes = "指定到转发的路由")
	@ApiVersions(group = ApiVersionConstant.FAP_APP100)
	public String sendTopicToMestemplate(@ApiParam(value = "自定义发送能容") @RequestParam(value = "str") String str) {
		senderConfTopicTemplate.sendTopicToMestemplate(str);
		return "Topic转发模式 指定到转发的路由 创建成功！";
	}
}
